package com.zhang.ziyan.service.impl;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhang.ziyan.mapper.UserMapper;
import com.zhang.ziyan.pojo.User;

import com.zhang.ziyan.service.UserService;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


import java.util.List;

@Service("userService")
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

     @Autowired
    private UserMapper userMapper;
    @Override
    public List<JSONObject> Login(JSONObject params) {
        return userMapper.Login(params);
    }

    @Override
    public Page<JSONObject> UserPage(JSONObject params) {
        Page<JSONObject> jsonObjectPage = userMapper.UserPage(new Page<JSONObject>(params.getLong("pageNo"), params.getLong("pageSize")), params);


        return jsonObjectPage;
    }

    @Override
    public JSONObject SelectRoleId(@Param("params") JSONObject params) {
        return userMapper.SelectRoleId(params);
    }


}
